{extend name="./oscshop/admin/view/public/base.html" /}
{block name="content"}
<div class="page-header">
	<h1>	
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb2}
		</small>
	</h1>
</div>

<div class="page-header">	
	<a href="{:url('MemberBackend/add')}" class="btn btn-primary">新增</a>
</div>		
<table class="table table-striped table-bordered table-hover search-form">
	<thead>
		
		<th><input name="user_name" type="text" placeholder="输入会员用户名" value="{:input('param.user_name')}" /></th>		
		
		<th>
			<a class="btn btn-primary" href="javascript:;" id="search" url="{:url('MemberBackend/index')}">查询</a>
		</th>
	</thead>
</table>	
	
<div class="row">
	<div class="col-xs-12">	
		<div class="table-responsive">
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>											
						<th>ID</th>
						<th>客户端</th> 
						<th>用户名</th> 
						<th>用户组</th>
						<th>登录次数</th> 						
						<th>创建时间</th>							
						<th>最后登录</th>		
					
						<th>操作</th>	
					</tr>
				</thead>
				<tbody>
						{volist name="list" id="v" empty="$empty"}
						<tr>						
							<td>{$v.uid}</td>
							<td>{$v.reg_type}</td>
							<td>
								{if condition="$v['reg_type'] NEQ 'weixin'"}
									{$v.username}
								{else/}
									{$v.nickname}
								{/if}
							</td>
							<td>
								{$v.title}
							</td>
							<td>{$v.loginnum}</td>
							<td>{if condition="$v['regdate'] neq 0"}{$v.regdate|date="Y-m-d",###}{else/}无{/if}</td>
							<td>
								{if condition="$v['lastdate'] neq 0"}{$v.lastdate|date="Y-m-d",###}{else/}无{/if}							
							</td>
							<td>
								<a  class="btn btn-xs btn-info" href='{:url("MemberBackend/edit",array("id"=>$v["uid"]))}'>
									<i class="fa fa-edit bigger-120"></i>
								</a> 
							</td>
						</tr>
						{/volist}	
						
						<tr>
							<td colspan="20" class="page">{$list->render()}</td>
						</tr>
				</tbody>
				
			</table>
		</div>
	</div>
</div>
{/block}
{block name="javascript"}
<script>	
$(function(){
   $("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });	
});
</script>
{/block}